package com.stock;

import java.util.HashMap;

// this class hold the stock data in specific date
// override functions description can be found in the implemented interfaces
public class StockData implements IStockRowData, IStockAvg {
	
	// the stock data
	private Long time;
	private Double openPrice;
	private Double highPrice;
	private Double lowPrice;
	private Double closingPrice;
	private Long volume;
	private HashMap<Integer,Double> avg;
	
	// c'tor
	public StockData(Long time, Double openPrice, Double hightPrice,
						Double lowPrice, Double closingPrice, Long volume, HashMap<Integer,Double> avg) {
		super();
		this.time = time;
		this.openPrice = openPrice;
		this.highPrice = hightPrice;
		this.lowPrice = lowPrice;
		this.closingPrice = closingPrice;
		this.volume = volume;
		this.avg = avg;
	}

	// getters:
	
	public Long getTime() {
		return time;
	}

	public Double getOpenPrice() {
		return openPrice;
	}

	public Double getHightPrice() {
		return highPrice;
	}

	public Double getLowPrice() {
		return lowPrice;
	}

	public Double getClosingPrice() {
		return closingPrice;
	}

	public Long getVolume() {
		return volume;
	}

	public double getAvg(int lastNumDays) {
		return avg.get(lastNumDays);
	}

	public HashMap<Integer, Double> getAvg() {
		return avg;
	}

}
